<?php
// +----------------------------------------------------------------------
// | 海豚PHP框架 [ DolphinPHP ]
// +----------------------------------------------------------------------
// | 版权所有 2016~2017 河源市卓锐科技有限公司 [ http://www.zrthink.com ]
// +----------------------------------------------------------------------
// | 官方网站: http://dolphinphp.com
// +----------------------------------------------------------------------
// | 开源协议 ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------

namespace app\common\model;

use think\Model as ThinkModel;

//商品表模型
class ProductCategory extends ThinkModel
{
    // 设置当前模型对应的完整数据表名称
    protected $table = '__QT_PRODUCT_CATEGORY__';
    protected $name = 'qt_product_category';
    protected $pk = 'id';
    protected $autoWriteTimestamp = true;


    /**
     *  分类列表
    **/
    public function getList($store_id = 0,$pid = 0)
    {
        $where   = [];
        $where[] = ['store_id','eq',$store_id];
        return $this->where($where)->order('sort asc,id desc')->field('id,name')->select();
    }

}